package java1;

import java.util.Scanner;

public class Number_ {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			String n = in.next(), str;
			char[] arr;
			int sum = 0;
			for (int i = 0; i < n.length(); i++) {
				arr = n.toCharArray();
				str = n.substring(i, i+1);
				if (arr[i] != '-' && arr[i] != '.') {
					sum += Integer.parseInt(str);
				}
			}
		System.out.println(sum);
		}
	}
}
